__author__ = 'hsd'

import pandas as pd
# Reading data locally
#df = pd.read_csv('/Users/al-ahmadgaidasaad/Documents/d.csv')
# Reading data from web
data_url = "https://raw.githubusercontent.com/alstat/Analysis-with-Programming/master/2014/Python/Numerical-Descriptions-of-the-Data/data.csv"
df = pd.read_csv(data_url)
#print df

# Head of the data
print df.head()
# OUTPUT
# Tail of the data
print df.tail()

# Extracting column names
print df.columns
# Extracting row names or the index
print df.index

# Transpose data
#print df.T
#print df.ix[:, 0].head()
#print df.ix[10:20, 0:3]

print df.describe()

from scipy import stats as ss
# Perform one sample t-test using 1500 as the true mean
print ss.ttest_1samp(a = df.ix[:, 'Abra'], popmean = 15000)

# Import the module for plotting
import matplotlib.pyplot as plt
plt.show(df.plot(kind = 'box'))

import matplotlib.pyplot as plt
pd.options.display.mpl_style = 'default' # Sets the plotting display theme to ggplot2
df.plot(kind = 'box')